﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LCARSLibrary;

namespace LCARS_Interface
{
    public partial class MusicObject : UserControl
    {
        public MusicObject()
        {
            InitializeComponent();
            areaPrimary.Color = Colors.Orange5;
            areaSecondary.Color = Colors.Orange5;
        }

        public override string Text
        {
            get
            {
                return areaPrimary.Text;
            }
            set
            {
                areaPrimary.Text = value;
            }
        }

        public new event EventHandler<MusicObjectEventArgs> Click;

        protected virtual void OnClick(object sender, MusicObjectEventArgs e)
        {
            EventHandler<MusicObjectEventArgs> temp = Click;
            if (temp != null)
            {
                temp(sender, e);
            }
        }

        protected override void OnClick(EventArgs e)
        {
        }

        private void areaPrimary_Click(object sender, EventArgs e)
        {
            this.OnClick(this, new MusicObjectEventArgs() { Secondary = false });
        }

        private void areaSecondary_Click(object sender, EventArgs e)
        {
            this.OnClick(this, new MusicObjectEventArgs() { Secondary = true });
        }
    }

    public class MusicObjectEventArgs : EventArgs
    {
        public bool Secondary { get; set; }
    }
}
